
//引入认证弹框组件
import XhPop from '@/components/xh-pop/xh-pop.vue'
import { createVNode, render } from 'vue'

export default {
	install(app) {
		//createVNode是vue提供的底层方法，创建虚拟DOM
		const vnode = createVNode(XhPop)
		//render把虚拟DOM生成真实DOM，并且挂载到指定节点
		render(vnode, document.body)
		//挂载到全局的uni对象上
		uni.$pop = {
			//认证弹框
			show: (params,callback) => vnode.component?.exposed?.show(params,callback),
			hide: () => vnode.component?.exposed?.hide()
		}
	}
}